<template>
  <div>
    <div>
      <div>&nbsp;</div>
      <div>&nbsp;</div>
      <div>&nbsp;</div>
      <div>&nbsp;</div>

      <van-cell-group>
        <div v-for="q in data.questions" :key="q.id">
          <van-cell :title="q.question" :value="q.value.display_name" />
        </div>
      </van-cell-group>

      <van-button size="small" @click.native="handleEdit"> 编辑 </van-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SurveyInput',
  components: {},
  directives: {},
  filters: {},
  props: {},

  data() {
    return {
      //
    }
  },
  computed: {
    data: function() {
      return this.$store.state.SurveyInput.dataDict
    }
  },
  async created() {
    const { id } = this.$route.query
    await this.$store.dispatch('SurveyInput/browse_question', { id })
    console.log('question,', this.data)
  },

  methods: {
    async handleEdit() {
      const { id } = this.$route.query
      this.$router.replace({
        path: '/consult/survey-input-form',
        query: { id }
      })
    }
  }
}
</script>

<style type="text/css"></style>
